<!-- commentaires  -->
{% if comments %}
    <p>Comments:</p>
{% endif %}

{% for comment in comments %}
    <div class="comment">
        <div class="time">{{ comment.date }} | {{ comment.auteur }}</div>
        <div class="body">{{ comment.texte|linebreaks }}</div>
    </div>
{% endfor %}

<div id="addc">Ajouter un commentaire</div>
<!-- formulaire pour un commentaire  -->
<form action="{% url twitter.views.add_comment post.id %}" method="POST">{% csrf_token %}
    <div id="cform">
        Name: {{ form.auteur }}
        <p>{{ form.texte|linebreaks }}</p>
    </div>
    <div id="submit"><input type="submit" value="Submit"></div>
</form>

<!-- AJOUTER LA SUPPRESSION DES COMMENTAIRES (TODO) -->

<!--<form action="{% url twitter.views.delete_comment post.pk %}" method="POST">{% csrf_token %}
{% for comment in comments %}
    <div class="comment">
        <div class="time">{{ comment.date }} | {{ comment.auteur }}</div>
        <div class="body">{{ comment.texte|linebreaks }}</div>
        {% if user.is_staff %}
            <input type="checkbox" name="delete" value="{{ comment.pk }}">
            <a href="{% url twitter.views.delete_comment post.pk comment.id %}">supprimer</a>
        {% endif %}
    </div>
{% endfor %}

{% if user.is_staff and comments %}
    <p><input type="submit" value="Delete all selected"></p>
    <br />
{% endif %}
</form>-->